<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
	'enableClientValidation'=>true,
	'htmlOptions' => array('enctype' => 'multipart/form-data'),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>
	
	<?php 	
		//Onclick of state, stateID will be posted by ajax and on the basis of stateID it will return list of city names
		$arrOptionsCity = array('prompt'=>'Select State','ajax'=> array('type'=>'POST',
				'url' => CController::createUrl('user/SearchCity'),
				'update'=>'#User_user_cityID'));
	?>

	<?php //echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'first_name'); ?>
		<?php echo $form->textField($model,'first_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'first_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'last_name'); ?>
		<?php echo $form->textField($model,'last_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'last_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'user_name'); ?>
		<?php echo $form->textField($model,'user_name',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'user_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'emailID'); ?>
		<?php echo $form->textField($model,'emailID',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'emailID'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'gender'); ?>
		<?php echo $form->dropDownList($model,'gender',array('0'=>'Male','1'=>'Female'),array('size'=>1,'maxlength'=>1)); ?>
		<?php echo $form->error($model,'gender'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'birth_date'); ?>
		<?php echo CHtml::activeTextField($model,'birth_date',array("id"=>"birth_date")); ?>
		<?php $this->widget('application.extensions.calendar.SCalendar',
			array(
			'inputField'=>'birth_date',
		    'ifFormat'=>'%Y-%m-%d',
			'showsTime'=>true,
			// 'position'=>"[400,200]",
			'range'=>"[1983,1996]"
		));
    ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'address'); ?>
		<?php echo $form->textField($model,'address',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'address'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'user_stateID'); ?>
		<?php echo $form->dropDownList($model,'user_stateID',State::model()->getStates(), $arrOptionsCity); ?>
		<?php echo $form->error($model,'user_stateID'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'user_cityID'); ?>
		<?php echo $form->dropDownList($model,'user_cityID',array(), array('empty' => 'Select a City')); ?>
		<?php echo $form->error($model,'user_cityID'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'mobile_number'); ?>
		<?php echo $form->textField($model,'mobile_number'); ?>
		<?php echo $form->error($model,'mobile_number'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'profile_image'); ?>
		<?php echo $form->fileField($model,'profile_image',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'profile_image'); ?>
	</div>

	<?php $this->widget('CCaptcha'); ?>
            <div class="captcha"><?php echo CHtml::activeTextField( $model,'verifyCode', array('class'=>'captcha')); ?></div>
    <?php echo $form->error($model,'verifyCode'); ?>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Submit' : 'Save'); ?>
	</div>
	
<?php $this->endWidget(); ?>

</div><!-- form -->